package com.ruoyi.common.enums;

import com.ruoyi.common.utils.StringUtils;

import java.math.BigDecimal;

/**
 * OA优先级枚举类
 *
 * @author yinjc
 */
public enum OAPriorityEnum {

    FOUR("2236286224109356295", new BigDecimal(4))
    , THREE("-3192492102191724869", new BigDecimal(3))
    , TWO("-409420425266445666", new BigDecimal(2))
    , ONE("-5593285363842792296", new BigDecimal(1))
    ;

    OAPriorityEnum(String oaPriority, BigDecimal oaPriorityValue) {
        this.oaPriority = oaPriority;
        this.oaPriorityValue = oaPriorityValue;
    }

    private final String oaPriority;
    private final BigDecimal oaPriorityValue;

    public String getOaPriority() {
        return oaPriority;
    }

    public BigDecimal getOaPriorityValue() {
        return oaPriorityValue;
    }

    public static BigDecimal getOaPriorityName(String oaPriority) {
        for (OAPriorityEnum oaPriorityEnum : values()) {
            if (StringUtils.equals(oaPriority, oaPriorityEnum.getOaPriority())) {
                return oaPriorityEnum.getOaPriorityValue();
            }
        }
        return null;
    }
}
